; Common rules for PTZ control commands
;
; Copyright (C) 2003 Huperlabs, Inc.

;;;;;;;;;; Hardware information ;;;;;;;;;;
; Model:

[HARDWARE]

; PTZ device model, product name
DeviceName=

; Commnunication speed
; {4800 | 9600}
BaudRate=

; Valid data bits
; {7 | 8}
DataBit=

; Parity check bit
; {N | O | E | M | S}
; N: no parity
; O: odd parity
; E: even parity
; M: mark
; S: space
Parity=

; Stop bit
; {1 | 2}
StopBit=

; Command length
; {FIXED | VAR}
; FIXED: command length is fixed
; VAR  : command length is variable, depending on control command
CmdLen=

;;;;;;;;;; Address setting ;;;;;;;;;;

[ADDRESS]

; Address command type
; {BITWISE | BCD | SYSTEM | PREFIX}
; BITWISE: the value should be bitwised
; BCD    : the value is BCD (binary coded decimal)
; SYSTEM : the value is calculated via a system method
; PREFIX : the value is prefixed to control command, using decimal system
TYPE=

; Type SYSTEM
; {10 | 16 | 32}
; 10: decimal system
; 16: hexadecimal system
; 32: carry by 32
SYSTEM=

CMD=

; Mask for BITWISE
MASK=

; Masks for BCD and SYSTEM
BCD_1S_MASK=
BCD_10S_MASK=
BCD_100S_MASK=

; Address range
MIN=
MAX=

;;;;;;;;;; Checksum calculation ;;;;;;;;;;

[CHECKSUM]

; Is check sum byte required?
; {TRUE | FALSE}
PRESENT=

; Check sum rule; how to calculate check sum byte
; {XOR | XNOR | SUM | SYNC_SUM | SIMPLE_SUM | COMPLE_SUM | NOT_SUM ...}
; XOR        : exclusive-OR (XOR) each byte; horizontal even parity
; XNOR       : exclusive-NOR (XNOR) each byte; horizontal odd parity
; SUM        : add each byte
; SYNC_SUM   : add each byte except SYNC byte
; SIMPLE_SUM : add each byte, then bitwised-AND 0x7F, i.e. bit 7 is always 0
; COMPLE_SUM : add each byte, using 2's complement (or subtract from 0x00) to calculate result
; NOT_SUM    : add each byte, using 1's complement (or bitwised-NOT) to calculate result
; COP_NOT_SUM: similar to NOT_SUM, excluding STX and ETX bytes
; SYNC_NOT_SUM: similar to NOT_SUM, excluding SYNC byte
; WONWOO1_SUM: add each byte, then plus 0x20
; WONWOO2_SUM: add each byte, then subtract from 0x2020
; MERIDIAN   : postfix, Meridian
; PACKET_PARITY: KD6, Ultrak, Diamond
; ACUTVISTA_SYNC_SUM: similar to SUM, excluding STX and ETX bytes, Acutvista P
; CRC16: CRC-16-CCITT, x^16 + x^12 + x^5 + 1
RULE=

;;;;;;;;;; PTZ device response ;;;;;;;;;;

[RESPONSE]
; Is response packet present?
; {TRUE | FALSE}
PRESENT=

; Response packet length if present
LENGTH=

;;;;;;;;;; Speed command ;;;;;;;;;;

[SPEED]

; Is speed command combined with other command?
; {TRUE | FALSE}
COMBINED=

; Specify standalone speed command format if required
PAN_SPEED_CMD=
PAN_SPEED_MASK=
TILT_SPEED_CMD=
TILT_SPEED_MASK=
ZOOM_SPEED_CMD=
ZOOM_SPEED_MASK=
IRIS_SPEED_CMD=
IRIS_SPEED_MASK=
FOCUS_SPEED_CMD=
FOCUS_SPEED_MASK=

; Speed command type
; {BITWISE | BCD | PREFIX}
; BITWISE: the value should be bitwised
; BCD    : the value is BCD (binary coded decimal)
; PREFIX : the value is prefixed to control command, using decimal system
TYPE=

PAN_SPEED_MIN=
PAN_SPEED_MAX=
TILT_SPEED_MIN=
TILT_SPEED_MAX=
ZOOM_SPEED_MIN=
ZOOM_SPEED_MAX=
IRIS_SPEED_MIN=
IRIS_SPEED_MAX=
FOCUS_SPEED_MIN=
FOCUS_SPEED_MAX=

;;;;;;;;;; Pan command ;;;;;;;;;;

[PAN]

; Is pan command auto-repeat?
; {TRUE | FALSE}
REPEAT=

LEFT=
RIGHT=

; If pan command is auto-repeat, how to stop the command
; {SPEED | OP_CODE}
; SPEED  : stop by setting a speed value
; OP_CODE: stop by command
STOP_TYPE=

; stop by speed
STOP_SPEED=

; stop by OP_CODE
STOP=
STOP_LEFT=
STOP_RIGHT=

;;;;;;;;;; Tilt command ;;;;;;;;;;

[TILT]

; Is tilt command auto-repeat?
; {TRUE | FALSE}
REPEAT=

UP=
DOWN=

; If tilt command is auto-repeat, how to stop the command
; {SPEED | OP_CODE}
; SPEED  : stop by setting a speed value
; OP_CODE: stop by command
STOP_TYPE=

; stop by speed
STOP_SPEED=

; stop by OP_CODE
STOP=
STOP_UP=
STOP_DOWN=

;;;;;;;;;; Glide command ;;;;;;;;;;

[GLIDE]

; Certain protocols provide glide command
; Others use pan and tilt to simulate

; {TRUE | FALSE}
REPEAT=

UPLEFT=
UPRIGHT=
DOWNLEFT=
DOWNRIGHT=

; {SPEED | OP_CODE}
STOP_TYPE=

; Stop by speed
STOP_SPEED=

; Stop by OP_CODE
STOP=

;;;;;;;;;; Zoom command ;;;;;;;;;;

[ZOOM]

; Is zoom command auto-repeat?
; {TRUE | FALSE}
REPEAT=

IN=
OUT=

; If zoom command is auto-repeat, how to stop the command
; {SPEED | OP_CODE}
; SPEED  : stop by setting a speed value
; OP_CODE: stop by command
STOP_TYPE=

; stop by speed
STOP_SPEED=

; stop by OP_CODE
STOP=
STOP_IN=
STOP_OUT=

;;;;;;;;;; Iris command ;;;;;;;;;;

[IRIS]

; Is iris command auto-repeat?
; {TRUE | FALSE}
REPEAT=

OPEN=
CLOSE=
AUTO=

; If iris command is auto-repeat, how to stop the command
; {SPEED | OP_CODE}
; SPEED  : stop by setting a speed value
; OP_CODE: stop by command
STOP_TYPE=

; stop by speed
STOP_SPEED=

; stop by OP_CODE
STOP=
STOP_OPEN=
STOP_CLOSE=
STOP_AUTO=

;;;;;;;;;; Focus command ;;;;;;;;;;

[FOCUS]

; Is focus command auto-repeat?
; {TRUE | FALSE}
REPEAT=

FAR=
NEAR=
AUTO=

; If focus command is auto-repeat, how to stop the command
; {SPEED | OP_CODE}
; SPEED  : stop by setting a speed value
; OP_CODE: stop by command
STOP_TYPE=

; stop by speed
STOP_SPEED=

; stop by OP_CODE
STOP=
STOP_FAR=
STOP_NEAR=
STOP_AUTO=

;;;;;;;;;; Preset command ;;;;;;;;;;

[PRESET]

; Preset command type
; {BITWISE | BCD | SYSTEM | PREFIX | LILIN | SENSORMATIC}
; BITWISE: the value should be bitwised
; BCD    : the value is binary coded decimal
; SYSTEM : the value is calculated via a system method
; PREFIX : the value is prefixed to control command, using decimal system
; LILIN  : uses Lilin's rule
; SENSORMATIC: uses Sensormaitc's rule
TYPE=

; Type SYSTEM
; {N}
; N: carry by N value
SYSTEM=

SET_CMD=
GOTO_CMD=

; Mask for BITWISE
SET_MASK=
GOTO_MASK=

; Masks for SYSTEM
SET_1S_MASK=
SET_10S_MASK=
GOTO_1S_MASK=
GOTO_10S_MASK=

; Stop preset command
STOP=

; Preset range
MIN=
MAX=

;;;;;;;;;; Auto-panning command ;;;;;;;;;;

[AUTOPAN]

; Is autopan command combined with action and preset positions?
; {TRUE | FALSE | LILIN | VCLTP}
; LILIN: uses Lilin's rule
; VCLTP: uses VCLTP's rule
COMBINED=

; Start autopan command
CMD=

; Set swing (or group) command
SET=

; Stop autopan command
STOP=

; Set start point command
START=

; Set end point command
END=

; Rotational direction
RIGHT=
LEFT=

; If the autopan command combined with action and preset positions
MASK_P1=
MASK_P2=

; Set speed command
SPEED_CMD=

; Mask for speed
SPEED_MASK=

; Speed Range
SPEED_MIN=
SPEED_MAX=

;;;;;;;;;; Reset command ;;;;;;;;;;

[RESET]

; Factory reset; camera reset; remote reset; home position ....
RESET=

;;;;;;;;;; OSD command ;;;;;;;;;;

[OSD]

; Main command to enter OSD
; Certain protocols use the same command to exit OSD
MENU=

; The ENTER command
; Certain protocols use the RIGHT (pan right) key to select item
ENTER=
ENTER_STOP=

; Procedure to exit OSD
; Certain protocols use the LEFT (pan left) key to jump to the Exit
; The EXIT2 command can be left blank if not required
EXIT=
EXIT_STOP=
EXIT2=
EXIT2_STOP=

; Certain protocols use special commands to operate OSD menu
LEFT=
RIGHT=
UP=
DOWN=
